<extend name="Common@Layout:layui-admin" />
<block name="title">
    <title>首页</title>
</block>
<block name="style">
    <style>

.my-header{width:150px}
.layui-layout-admin .my-header .my-header-logo {width:170px;text-align:center}
    </style>
</block>

<block name="main">
    <!-- layout admin -->
    <div class="layui-layout layui-layout-admin">
        <!-- 添加skin-1类可手动修改主题为纯白，添加skin-2类可手动修改主题为蓝白 -->
        <!-- header -->
        <div class="layui-header my-header">
            <a href="/admin.html">
                
                	<php>$adtitle=F('Options/option_adminstrator_admin-title')?F('Options/option_adminstrator_admin-title'):Administrator;</php>
                <div class="my-header-logo" >{$adtitle}</div>
            </a>
            <if condition="$_SESSION['loginUser']['role'] == 'SUPER_ADMIN'">
	            <div class="my-header-btn">
	                <a class="layui-btn layui-btn-small" onclick="shouxiao()">
	               		<img id="xuanzhuantu" src="/Public/img/shouxiao.png" style="width:16px;" />
	                </a>
	            </div>
			</if>
            <!-- 顶部左侧添加选项卡监听 -->
            <ul class="layui-nav" lay-filter="side-top-left">
            </ul>

            <!-- 顶部右侧添加选项卡监听 -->
            <ul class="layui-nav my-header-user-nav" lay-filter="side-top-right">
                <li class="layui-nav-item">
                    <a href="/"> ‹ 返回主页</a>
                </li>
                <li class="layui-nav-item">
                    <a class="name" href="javascript:;"><i class="layui-icon">&#xe629;</i>主题</a>
                    <dl class="layui-nav-child">
                        <dd data-skin="0"><a href="javascript:;">默认</a></dd>
                        <dd data-skin="1"><a href="javascript:;">纯白</a></dd>
                        <dd data-skin="2"><a href="javascript:;">蓝白</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="name" href="javascript:;">
                        <img src="{$_SESSION['loginUser']['avater']|default='/Public/res/images/avatar/default.png'}" id="nav_avatar_image">
                        <cite>{$_SESSION['loginUser']['username']}</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="/user/login/logout.html"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>{:L('logout')}</a>
                        </dd>
                    </dl>
                </li>
            </ul>

        </div>
        <!-- side -->
        <div class="layui-side my-side">
            <div class="layui-side-scroll">
                <!-- 左侧主菜单添加选项卡监听 -->
                <ul class="layui-nav layui-nav-tree" lay-filter="side-main"></ul>
            </div>
        </div>
        <!-- body -->
        <div class="layui-body my-body">
            <div class="layui-tab layui-tab-card my-tab" lay-filter="card" lay-allowClose="true">
                <ul class="layui-tab-title">
                    <li class="layui-this" lay-id="1"><span><i class="layui-icon">&#xe638;</i>欢迎页</span></li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <iframe id="iframe" src="/Admin/Homeindex/index.html" frameborder="0"></iframe>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- 右键菜单 -->
    <div class="my-dblclick-box none">
        <table class="layui-tab dblclick-tab">
            <tr class="card-refresh">
                <td><i class="layui-icon">&#x1002;</i>刷新当前页面</td>
            </tr>
            <tr class="card-close">
                <td><i class="layui-icon">&#x1006;</i>关闭当前页面</td>
            </tr>
        </table>
    </div>

</block>

<block name="script">
    <script type="text/javascript">
    	var $;
    	var current = 0;
    	var tmpint=0;
        var jsonUrl = '/tools/json/getjson?key=';
        var topMenuKey = '{$_SESSION['loginUser']['role']}_top'; //默认的key
        var mainMenuKey = '{$_SESSION['loginUser']['role']}_main'; //默认主菜单key
        layui.use(['layer', 'vip_nav'], function() {

            // 操作对象
            $ = layui.jquery;
            var layer = layui.layer,
                vipNav = layui.vip_nav;

            // 顶部左侧菜单生成 [请求地址,过滤ID,是否展开,携带参数]
            vipNav.top_left(jsonUrl + topMenuKey, 'side-top-left', false);
            // 主体菜单生成 [请求地址,过滤ID,是否展开,携带参数]
            vipNav.main(jsonUrl + mainMenuKey, 'side-main', true);

		


        });
        
        function shouxiao(){
			var left = $('.layui-side').css('left')=='0px'?'-200px':'0px';
			var b = $('.layui-body').css('left')=='0px'?'200px':'0px';
        	$('.layui-side').css('left',left)
        	$('.layui-body').css('left',b)
    		current = (current+180)%360;
    		document.getElementById('xuanzhuantu').style.transform= 'rotate('+current+'deg)';
        }
        
    </script>
</block>